package com.xsomnus.java_basic.jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 叶小夏
 * @since 2019-08-19 15:10
 * VM Args: -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 */
public class HeapOOM {

    static class OOMObject {

    }

    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<>();
        while (true) {
            list.add(new OOMObject());
        }
    }
}
